//引入接口
import API from '../../config/server.js';
Page({
  data:{
    skin:[]
  },
  onLoad()
  {
    this.getSkin()
  },
  getSkin(){
    let that = this;
    wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: API.heroskin,
      method: 'GET',
      dataType: 'json',
      success: function (res) {

        let skin = res.data.data;
        console.log(skin)
        that.setData({
          skin: skin,
          // cateId: cate.dhty_e9[0].yxid_a7
        });
      },
      fail: function (res) {
        wx.showToast({
          title: '网络错误',
          icon: 'error'
        })
      },
      complete: function (res) {
        wx.hideLoading()  //关闭loading
      },
    })
  },
  toSkinInfo(e){
    let url = e.currentTarget.dataset.url;
    wx.navigateTo({
      url: `/pages/skinInfo/skinInfo?url=${url}`,
    })
  }
})